One or more aspects relate, in general, to relocation of instructions, and in particular, to the relocation of instructions that use relative addressing.
Some instruction set architectures include instructions that use relative addressing to access data. One type of relative addressing is program counter (PC)-relative addressing, in which an offset or displacement is provided from a current program counter address, and the resulting address is used to access the data. This enables position independent coding, in which such instructions are able to be loaded at different memory locations without affecting access to the data by those instructions, assuming the data remains in the same relative position from the instructions. That is, assuming the data remains at the offset from the program counter.
Examples of instructions that use PC-relative addressing include the load relative instruction and the store relative instruction, offered as part of the Z/ARCHITECTURE, provided by International Business Machines Corporation, Armonk, N.Y.